<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBrokersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('brokers', function (Blueprint $table) {
            $table->increments('id');
            $table->string('true_name')->default('')->comment('经纪人姓名');
            $table->char('phone')->comment('经纪人手机号');
            $table->tinyInteger('sex')->default('0')->comment('经纪人性别 0：女 1：男 默认为女');
            $table->integer('company_id')->default('0')->comment('公司ID 0为自由经纪人');
            $table->string('address')->default('')->comment('详细地址');
            $table->integer('area_id')->default('1')->comment('区域ID(城市表id)');
            $table->string('avatar_url')->default('https://aguo2.oss-cn-shanghai.aliyuncs.com/images/20201218042415721.jpg')->comment('经纪人头像');
            $table->string('open_id')->nullable()->comment('微信小程序唯一标识');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('brokers');
    }
}
